﻿using ConsoleApp.Job.TaskFramework;
using ConsoleApp.Rmq;
using ConsoleAppFramework.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleAppFramework.Job.TaskJob.队列消费
{
    public class Canal消费任务 : TaskBase
    {
        public override void Execute()
        {
            while (true)
            {
                new Rmq测试任务消费_RMQ(RmqQueueManager.QueueName.Canal消息).HandleOneMessage();
            }
        }

        public class Canal消费任务_RMQ : ConsumerWorkerBase<string>
        {
            public Canal消费任务_RMQ(string queueName)
            {
                Console.Title = queueName;
                QueueName = queueName;
            }

            protected override bool HandleComingMessage(string str)
            {
                ConsoleHelper.WriteWarningLine($"Canal消息:{str}");
                return true;
            }
        }
    }
}
